package com.hxkcloud.nurse.beans;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by william_sun on 2016-09-19.
 * Description:Parcelable test
 */
public class ParcelableBean implements Parcelable {
    private String name;
    private String id;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeString(id);
    }

    public static final Parcelable.Creator<ParcelableBean> CREATOR = new Parcelable.Creator<ParcelableBean>() {
        @Override
        public ParcelableBean createFromParcel(Parcel source) {
            ParcelableBean bean = new ParcelableBean();
            bean.setName(source.readString());
            bean.setId(source.readString());
            return bean;
        }

        @Override
        public ParcelableBean[] newArray(int size) {
            return new ParcelableBean[size];
        }
    };
}
